package com.crm.service.impl;

import com.crm.entity.Module;
import com.crm.mapper.ModuleMapper;
import com.crm.service.ModuleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author crm
 * @since 2020-06-05
 */
@Service//表示当前类是service层，也表示把当前类交给spring管理，ioc控制反转，需要时由spring创建对象
public class ModuleServiceImpl extends ServiceImpl<ModuleMapper, Module> implements ModuleService {
                            //继承了mybatis plus的接口实现，基本的增删改查方法都已经帮我们实现了
    @Resource
    private ModuleMapper moduleMapper;//注入mapper，因为service要调用mapper
    @Override
    public List<Module> GetSysRightsJsonLayUI(Integer rid) {
        return moduleMapper.GetSysRightsJsonLayUI(rid);
    }

    @Override
    public List<Module> getModuleById(Integer mid) {
        return moduleMapper.getModuleById(mid);
    }

    @Override
    public List<Module> getRightsModile(String[] ids) {
        return moduleMapper.getRightsModile(ids);
    }

    @Override
    public List<Module> getAllModule() {
        return moduleMapper.getAllModule();
    }
}
